﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Silvermoon.Debug;
using Vault.Controllers;
using Silvermoon.Navigation;

namespace Vault
{
    public partial class HostWindow : Form
    {
        Silvermoon.Core.Screen screen;

        public HostWindow()
        {
            Debugger.Monitor = false;
            InitializeComponent();
            InitializeSilvermoon();
        }

        private void InitializeSilvermoon()
        {
            screen = Silvermoon.Core.Screen.Initialize(this);
            screen.Renderer.BackgroundColor = Color.Black;
            screen.Renderer.Perspective = true;

            var view = new LoginView();
            view.PreLoad();
            view.Invoke(() =>
                {
                    view.NavigateTo(view, NavigationOption.KeepAlive, PageTransition.ShowAndHide);
                });
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            if (screen != null)
            {
                screen.Invalidate();
                screen.Update();
            }
        }

        protected override void OnPaintBackground(PaintEventArgs e)
        {
        }

    }
}